Top |
gboolean | activate | Run Last |
void | changed | Run Last |
void | clear-cell | Run Last |
void | clip-range | Run Last |
gboolean | deactivate | Run Last |
gboolean | enter-pressed | Run Last |
gboolean | entry-focus-in | Run Last |
gboolean | entry-focus-out | Run Last |
void | move-cursor | Action |
void | move-range | Run Last |
void | new-column-width | Run Last |
void | new-row-height | Run Last |
void | populate-popup | Run Last |
void | resize-range | Run Last |
void | select-column | Run Last |
void | select-range | Run Last |
void | select-row | Run Last |
void | set-cell | Run Last |
void | set-scroll-adjustments | Run Last |
gboolean | traverse | Run Last |
enum | GtkSheetAttrType |
enum | GtkSheetState |
enum | GtkSheetEntryType |
enum | GtkSheetVerticalJustification |
enum | GtkSheetTraverseType |
#define | GTK_SHEET_OPTIMIZE_COLUMN_DRAW |
struct | GtkSheetChild |
struct | GtkSheetButton |
struct | GtkSheetCellBorder |
struct | GtkSheetCellAttr |
struct | GtkSheetCell |
struct | GtkSheetRange |
struct | GtkSheetRow |
struct | GtkSheet |
GtkSheetColumn | |
GtkSheetColumnClass |
GBoxed ╰── GtkSheetRange GObject ╰── GInitiallyUnowned ╰── GtkObject ╰── GtkWidget ├── GtkContainer │ ╰── GtkSheet ╰── GtkSheetColumn
GtkSheet implements AtkImplementorIface and GtkBuildable.
GtkSheetColumn implements AtkImplementorIface and GtkBuildable.
GtkSheet is a matrix widget for GTK+. It consists of an scrollable grid of cells where you can put text or other GtkWidget's in. Cells are organized in rows (GtkSheetRow) and columns (GtkSheetColumn). Cell contents can be edited interactively through a specially designed entry (GtkItemEntry). A GtkSheet is also a container subclass, allowing you to display buttons, curves, pixmaps and any other widget in it. You can also set many attributes as: border, foreground and background color, text justification, and more. The testgtksheet program shows how easy is to create a spreadsheet-like GUI using this widget set.
#define GTK_SHEET_COLUMN_FROZEN(sheet) !gtk_sheet_columns_resizable(sheet)
#define GTK_SHEET_ROW_TITLES_VISIBLE(sheet) gtk_sheet_row_titles_visible(sheet)
#define GTK_SHEET_COL_TITLES_VISIBLE(sheet) gtk_sheet_column_titles_visible(sheet)
GtkWidget * gtk_sheet_new (guint rows
,guint columns
,const gchar *title
);
Creates a new sheet widget with the given number of rows and columns.
void gtk_sheet_construct (GtkSheet *sheet
,guint rows
,guint columns
,const gchar *title
);
Initializes an existent GtkSheet with the given number of rows and columns.
GtkWidget * gtk_sheet_new_browser (guint rows
,guint columns
,const gchar *title
);
Creates a new browser sheet. Its cells cannot be edited(read-only).
void gtk_sheet_construct_browser (GtkSheet *sheet
,guint rows
,guint columns
,const gchar *title
);
Initializes an existent read-only GtkSheet with the given number of rows and columns.
GtkWidget * gtk_sheet_new_with_custom_entry (guint rows
,guint columns
,const gchar *title
,GType entry_type
);
Creates a new sheet widget with the given number of rows and columns and a custome entry type.
rows |
initial number of rows |
|
columns |
initial number of columns |
|
title |
sheet title |
|
entry_type |
a GType |
void gtk_sheet_construct_with_custom_entry (GtkSheet *sheet
,guint rows
,guint columns
,const gchar *title
,GType entry_type
);
Initializes an existent read-only GtkSheet with the given number of rows and columns and a custom entry.
void gtk_sheet_set_hadjustment (GtkSheet *sheet
,GtkAdjustment *adjustment
);
Change horizontal scroll adjustments.
void gtk_sheet_set_vadjustment (GtkSheet *sheet
,GtkAdjustment *adjustment
);
Change vertical scroll adjustments.
void gtk_sheet_change_entry (GtkSheet *sheet
,const GType entry_type
);
Changes the current entry of the cell in GtkSheet. The old sheet entry widget gets dropped and a new entry widget is created. Beware: You will have to reconnect all your signal handlers after changing an entry.
GType
gtk_sheet_get_entry_type (GtkSheet *sheet
);
Get sheets entry type, if known
GtkWidget *
gtk_sheet_get_entry (GtkSheet *sheet
);
Get sheet's entry widget.
If the entry widget is a container, the direct childs of the
container are searched for a valid entry widget. If you want
the container itself to be returned, you should use
gtk_sheet_get_entry_widget()
instead.
GtkWidget *
gtk_sheet_get_entry_widget (GtkSheet *sheet
);
Get sheet's entry widget.
If the entry widget is a container, the container widget is
returned. In order to get the entry in the container child,
you might want to use gtk_sheet_get_entry()
instead.
gchar *
gtk_sheet_get_entry_text (GtkSheet *sheet
);
Get the text out of the sheet_entry.
This function is mainly used to synchronize the text of a second entry with the sheet_entry.
This function is necessary, because not all possible entry widgets implement the GtkEditable interface yet.
a copy of the sheet_entry text or NULL. This
function returns an allocated string, so g_free()
it after
usage!
void gtk_sheet_set_entry_text (GtkSheet *sheet
,const gchar *text
);
Set the text in the sheet_entry (and active cell).
This function is mainly used to synchronize the text of a second entry with the sheet_entry.
This function is necessary, because not all possible entry widgets implement the GtkEditable interface yet.
void gtk_sheet_set_entry_editable (GtkSheet *sheet
,const gboolean editable
);
Set the editable flag in the sheet_entry
This function is mainly used to synchronize the editable flag of a second entry with the sheet_entry.
This function is necessary, because not all possible entry widgets implement the GtkEditable interface yet.
void gtk_sheet_entry_select_region (GtkSheet *sheet
,gint start_pos
,gint end_pos
);
Selects a region of text.
This function is necessary, because not all possible entry widgets implement the GtkEditable interface yet.
gulong gtk_sheet_entry_signal_connect_changed (GtkSheet *sheet
,GCallback handler
);
Connect a handler to the sheet_entry "changed" signal. The user_data argument of the handler will be filled with the GtkSheet.
This function is mainly used to synchronize a second entry widget with the sheet_entry.
This function is necessary, because not all possible entry widgets implement the GtkEditable interface yet.
void gtk_sheet_entry_signal_disconnect_by_func (GtkSheet *sheet
,GCallback handler
);
Disconnect a handler from the sheet_entry "changed" signal
This function is mainly used to synchronize a second entry widget with the sheet_entry.
This function is necessary, because not all possible entry widgets implement the GtkEditable interface yet.
GtkSheetState
gtk_sheet_get_state (GtkSheet *sheet
);
Get the selection state of the sheet (GtkSheetState).
guint
gtk_sheet_get_rows_count (GtkSheet *sheet
);
Get the number of the rows of the GtkSheet.
guint
gtk_sheet_get_columns_count (GtkSheet *sheet
);
Get the number of the columns of the GtkSheet.
void gtk_sheet_get_visible_range (GtkSheet *sheet
,GtkSheetRange *range
);
Get sheet's ranges in a GkSheetRange structure.
sheet |
a GtkSheet. |
|
range |
a selected GtkSheetRange struct _GtkSheetRange { gint row0,col0; // upper-left cell gint rowi,coli; // lower-right cell }; |
gboolean gtk_sheet_get_selection (GtkSheet *sheet
,GtkSheetState *state
,GtkSheetRange *range
);
Inquire current cell selection state and range.
sheet |
a GtkSheet |
|
state |
where to store the GtkSheetState, may be NULL |
|
range |
where to store the GtkSheetRange |
void gtk_sheet_set_selection_mode (GtkSheet *sheet
,GtkSelectionMode mode
);
Sets the selection mode of the cells in a GtkSheet.
void gtk_sheet_set_autoresize (GtkSheet *sheet
,gboolean autoresize
);
Controls wether cells will be autoresized upon deactivation, as you type text or set a cell_text value. If you want the cells to be autoresized when you pack widgets look at gtk_sheet_attach_*(). This function sets both: autoresize_columns and autoresize_cells.
void gtk_sheet_set_autoresize_columns (GtkSheet *sheet
,gboolean autoresize
);
Controls wether columns will be autoresized upon deactivation, as you type text or set a cell_text value. If you want the cells to be autoresized when you pack widgets look at gtk_sheet_attach_*().
void gtk_sheet_set_autoresize_rows (GtkSheet *sheet
,gboolean autoresize
);
Controls wether rows will be autoresized upon deactivation, as you type text or set a cell_text value. If you want the cells to be autoresized when you pack widgets look at gtk_sheet_attach_*().
gboolean
gtk_sheet_autoresize (GtkSheet *sheet
);
Gets the autoresize mode of GtkSheet.
gboolean
gtk_sheet_autoresize_columns (GtkSheet *sheet
);
Gets the autoresize mode for GtkSheet columns.
gboolean
gtk_sheet_autoresize_rows (GtkSheet *sheet
);
Gets the autoresize mode for GtkSheet rows.
void gtk_sheet_set_autoscroll (GtkSheet *sheet
,gboolean autoscroll
);
The sheet will be automatically scrolled when you move beyond the last row/col in GtkSheet.
gboolean
gtk_sheet_autoscroll (GtkSheet *sheet
);
Get the autoscroll mode of GtkSheet.
void gtk_sheet_set_clip_text (GtkSheet *sheet
,gboolean clip_text
);
Clip text in cell. When clip text mode is turned off, cell text is written over neighbour columns, as long as their contents are empty.
gboolean
gtk_sheet_clip_text (GtkSheet *sheet
);
Get clip text mode in GtkSheet. When clip text mode is turned off, cell text is written over neighbour columns, as long as their contents are empty.
void gtk_sheet_set_justify_entry (GtkSheet *sheet
,gboolean justify
);
Justify cell entry editor in GtkSheet.
gboolean
gtk_sheet_justify_entry (GtkSheet *sheet
);
Get the cell entry editor justification setting from GtkSheet.
void gtk_sheet_set_vjustification (GtkSheet *sheet
,GtkSheetVerticalJustification vjust
);
Set the default vertical cell text justification for GtkSheet.
GtkSheetVerticalJustification
gtk_sheet_get_vjustification (GtkSheet *sheet
);
Get the default vertical cell text justification from GtkSheet.
void gtk_sheet_set_traverse_type (GtkSheet *sheet
,GtkSheetTraverseType ttype
);
Set the default traversal type for cursor movement in a GtkSheet.
GtkSheetTraverseType
gtk_sheet_get_traverse_type (GtkSheet *sheet
);
Get the default cell traversal type from GtkSheet.
void gtk_sheet_set_locked (GtkSheet *sheet
,gboolean locked
);
Lock the GtkSheet, which means it is no longer editable, cell contents cannot be modified by the user.
gboolean
gtk_sheet_locked (GtkSheet *sheet
);
Get the lock status of GtkSheet, locked means the sheet is not editable, cell contents cannot be modified by the user.
void gtk_sheet_set_title (GtkSheet *sheet
,const gchar *title
);
Set GtkSheet title. The widget will keep a copy of the string.
void gtk_sheet_set_description (GtkSheet *sheet
,const gchar *description
);
Set GtkSheet description for application use.
const gchar * gtk_sheet_get_description (GtkSheet *sheet
,const gchar *description
);
Get sheet description.
void
gtk_sheet_freeze (GtkSheet *sheet
);
Freeze all visual updates of the GtkSheet. The updates will occure in a more efficient way than if you made them on a unfrozen GtkSheet .
void
gtk_sheet_thaw (GtkSheet *sheet
);
Thaw the sheet after you have made a number of changes on a frozen sheet. The updates will occure in a more efficient way than if you made them on a unfrozen sheet .
void gtk_sheet_set_background (GtkSheet *sheet
,GdkColor *color
);
Sets the background color of the GtkSheet. If pass NULL, the sheet will be reset to the default color.
void gtk_sheet_set_grid (GtkSheet *sheet
,GdkColor *color
);
Set the grid color. If pass NULL, the grid will be reset to the default color.
void gtk_sheet_show_grid (GtkSheet *sheet
,gboolean show
);
Sets the visibility of grid in GtkSheet.
gboolean
gtk_sheet_grid_visible (GtkSheet *sheet
);
Gets the visibility of grid in GtkSheet.
void gtk_sheet_set_row_title (GtkSheet *sheet
,gint row
,const gchar *title
);
Set row title.
const gchar * gtk_sheet_get_row_title (GtkSheet *sheet
,gint row
);
Get row title.
void gtk_sheet_row_button_add_label (GtkSheet *sheet
,gint row
,const gchar *label
);
Set button label.It is used to set a row title.
const gchar * gtk_sheet_row_button_get_label (GtkSheet *sheet
,gint row
);
Get a row button label.
void gtk_sheet_row_button_justify (GtkSheet *sheet
,gint row
,GtkJustification justification
);
Set the justification(alignment) of the row buttons.
sheet |
a GtkSheet. |
|
row |
row number |
|
justification |
a GtkJustification :GTK_JUSTIFY_LEFT, RIGHT, CENTER |
void gtk_sheet_moveto (GtkSheet *sheet
,gint row
,gint column
,gint row_align
,gint col_align
);
Scroll the viewing area of the sheet to the given column and row;
row_align and col_align are between 0-1 representing the location the row should appear on the screnn, 0 being top or left, 1 being bottom or right.
passing row_align/col_align of -1 will suppress movement in that direction.
if row or column is negative then there is no change
sheet |
a GtkSheet. |
|
row |
row number |
|
column |
column number |
|
row_align |
row alignment |
|
col_align |
column alignment |
void gtk_sheet_set_row_titles_width (GtkSheet *sheet
,guint width
);
Resize row titles area.
gboolean
gtk_sheet_row_titles_visible (GtkSheet *sheet
);
Get the visibility of row column titles .
gboolean gtk_sheet_row_sensitive (GtkSheet *sheet
,gint row
);
Get row button sensitivity.
void gtk_sheet_row_set_sensitivity (GtkSheet *sheet
,gint row
,gboolean sensitive
);
Set row button sensitivity. If sensitivity is TRUE can be toggled, otherwise it acts as a title .
void gtk_sheet_rows_set_sensitivity (GtkSheet *sheet
,gboolean sensitive
);
Set rows 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 rows.
gboolean
gtk_sheet_rows_resizable (GtkSheet *sheet
);
Get rows resizable status.
void gtk_sheet_rows_set_resizable (GtkSheet *sheet
,gboolean resizable
);
Set rows resizable status.
gboolean gtk_sheet_row_visible (GtkSheet *sheet
,gint row
);
Get row visibility.
void gtk_sheet_row_set_visibility (GtkSheet *sheet
,gint row
,gboolean visible
);
Set row visibility. The default value is TRUE. If FALSE, the row is hidden.
void gtk_sheet_row_label_set_visibility (GtkSheet *sheet
,gint row
,gboolean visible
);
Set row label visibility.
void gtk_sheet_rows_labels_set_visibility (GtkSheet *sheet
,gboolean visible
);
Set all rows label visibility. The sheet itself has no such property, this is a convenience function to set the property for all existing rows.
gchar *
gtk_sheet_get_tooltip_markup (GtkSheet *sheet
);
Gets the contents of the tooltip (markup) for sheet
void gtk_sheet_set_tooltip_markup (GtkSheet *sheet
,const gchar *markup
);
Sets markup as the contents of the tooltip, which is marked up with the Pango text markup language.
gchar *
gtk_sheet_get_tooltip_text (GtkSheet *sheet
);
Gets the contents of the tooltip for the GtkSheet
void gtk_sheet_set_tooltip_text (GtkSheet *sheet
,const gchar *text
);
Sets text as the contents of the tooltip.
gchar * gtk_sheet_row_get_tooltip_markup (GtkSheet *sheet
,const gint row
);
Gets the contents of the tooltip (markup) for the column
void gtk_sheet_row_set_tooltip_markup (GtkSheet *sheet
,const gint row
,const gchar *markup
);
Sets markup as the contents of the tooltip, which is marked up with the Pango text markup language.
gchar * gtk_sheet_row_get_tooltip_text (GtkSheet *sheet
,const gint row
);
Gets the contents of the tooltip for the column
void gtk_sheet_row_set_tooltip_text (GtkSheet *sheet
,const gint row
,const gchar *text
);
Sets text as the contents of the tooltip.
gboolean gtk_sheet_row_get_readonly (GtkSheet *sheet
,const gint row
);
Gets the row readonly flag
void gtk_sheet_row_set_readonly (GtkSheet *sheet
,const gint row
,const gboolean is_readonly
);
Sets the row readonly flag. A cell is editable if the sheet is not locked, the row is not readonly and the cell (-range) was set to editable.
gboolean gtk_sheet_row_get_can_focus (GtkSheet *sheet
,const gint row
);
Gets the row can_focus flag
void gtk_sheet_row_set_can_focus (GtkSheet *sheet
,const gint row
,const gboolean can_focus
);
Sets the row can_focus flag.
Note: Does not check row visiblity, sensitivity, etc. Use the
macro GTK_SHEET_ROW_CAN_GRAB_FOCUS()
for dependency checking.
gchar * gtk_sheet_cell_get_tooltip_markup (GtkSheet *sheet
,const gint row
,const gint col
);
Gets the contents of the tooltip (markup) for the column
void gtk_sheet_cell_set_tooltip_markup (GtkSheet *sheet
,const gint row
,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. |
|
row |
row index |
|
col |
column index |
|
markup |
the contents of the tooltip for widget, or NULL. |
gchar * gtk_sheet_cell_get_tooltip_text (GtkSheet *sheet
,const gint row
,const gint col
);
Gets the contents of the tooltip for the column
void gtk_sheet_cell_set_tooltip_text (GtkSheet *sheet
,const gint row
,const gint col
,const gchar *text
);
Sets text as the contents of the tooltip.
sheet |
a GtkSheet. |
|
row |
row index |
|
col |
column index |
|
text |
the contents of the tooltip for widget |
gboolean gtk_sheet_cell_get_editable (GtkSheet *sheet
,const gint row
,const gint col
);
Check editable status of sheet, row, column and cell to decide if a sheet cell is editable
TRUE if editable, FALSE if blocked by any level. NOTE: this routine also checks if the sheet row/column/cell can receive focus. A cell may be editable, but not focusable still rendering it unable to be changed by the user.
To check only the editable attribute on the cell,
use gtk_sheet_get_attributes()
to fetch cell attributes and
examine them.
void gtk_sheet_cell_set_editable (GtkSheet *sheet
,const gint row
,const gint col
,const gboolean is_editable
);
Sets cell editable status in cell attributes.
sheet |
a GtkSheet. |
|
row |
row index |
|
col |
column index |
|
is_editable |
value for the editable status of the cell |
gboolean gtk_sheet_cell_get_sensitive (GtkSheet *sheet
,const gint row
,const gint col
);
Check sensitivity status of sheet, row, column and cell to decide if a sheet cell can receive focus.
void gtk_sheet_cell_set_sensitive (GtkSheet *sheet
,const gint row
,const gint col
,const gboolean is_sensitive
);
Sets cell sensitive status
sheet |
a GtkSheet. |
|
row |
row index |
|
col |
column index |
|
is_sensitive |
value for the sensitive status of the cell |
gboolean gtk_sheet_cell_get_can_focus (GtkSheet *sheet
,const gint row
,const gint col
);
Check ability of cell to grab focus. Check includes checking for blocks at row/column/sheet level.
void gtk_sheet_cell_set_can_focus (GtkSheet *sheet
,const gint row
,const gint col
,const gboolean can_focus
);
Sets cell can_focus flag
sheet |
a GtkSheet. |
|
row |
row index |
|
col |
column index |
|
can_focus |
value for the editable status of the cell |
void gtk_sheet_select_row (GtkSheet *sheet
,gint row
);
Select the row. The range is then highlighted, and the bounds are stored in sheet->range.
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.
void gtk_sheet_select_range (GtkSheet *sheet
,const GtkSheetRange *range
);
Highlight the selected range and store bounds in sheet->range
void gtk_sheet_clip_range (GtkSheet *sheet
,const GtkSheetRange *clip_range
);
Save selected range to "clipboard".
GtkAdjustment *
gtk_sheet_get_vadjustment (GtkSheet *sheet
);
Get vertical scroll adjustments.
GtkAdjustment *
gtk_sheet_get_hadjustment (GtkSheet *sheet
);
Get horizontal scroll adjustments.
void
gtk_sheet_unselect_range (GtkSheet *sheet
);
Unselect the current selected range and clears the bounds in sheet->range.
gboolean gtk_sheet_set_active_cell (GtkSheet *sheet
,gint row
,gint column
);
Set active cell where the cell entry will be displayed. Use (row,col) = (-1,-1) to deactivate active cell.
void gtk_sheet_get_active_cell (GtkSheet *sheet
,gint *row
,gint *column
);
Store the coordinates of the active cell in row,col. If (row<0 || col<0) then there was no active cell in the sheet.
void gtk_sheet_set_tab_direction (GtkSheet *sheet
,GtkDirectionType dir
);
Sets a primary movement direction to the Tab, Return and Enter keys, and assigns the opposite direction to the same keys with GDK_SHIFT_MASK.
Transposed movement direction can be accessed with GTK_SHEET_MOD_MASK|GDK_CONTROL_MASK and GTK_SHEET_MOD_MASK|GDK_CONTROL_MASK|GDK_SHIFT_MASK.
All bindings are defined for the GtkSheetClass, so all sheet instances use the same movement directions.
Default: GTK_DIR_TAB_FORWARD.
Since: 3.0.2
void gtk_sheet_set_cell (GtkSheet *sheet
,gint row
,gint col
,GtkJustification justification
,const gchar *text
);
Set cell contents and allocate memory if needed.
sheet |
a GtkSheet. |
|
row |
row_number |
|
col |
column number |
|
justification |
a GtkJustification :GTK_JUSTIFY_LEFT, RIGHT, CENTER |
|
text |
cell text |
void gtk_sheet_set_cell_text (GtkSheet *sheet
,gint row
,gint col
,const gchar *text
);
Set cell contents and allocate memory if needed. No justifcation is made. attributes and links remain unchanged.
gchar * gtk_sheet_cell_get_text (GtkSheet *sheet
,gint row
,gint col
);
Get cell text.
void gtk_sheet_cell_clear (GtkSheet *sheet
,gint row
,gint column
);
Clear cell contents.
void gtk_sheet_cell_delete (GtkSheet *sheet
,gint row
,gint column
);
Clear cell contents and remove links.
void gtk_sheet_range_clear (GtkSheet *sheet
,const GtkSheetRange *range
);
Clear range contents. If range==NULL the whole sheet will be cleared.
void gtk_sheet_range_delete (GtkSheet *sheet
,const GtkSheetRange *range
);
Clear range contents and remove links. FIXME:: if range==NULL whole sheet is deleted?
GtkStateType gtk_sheet_cell_get_state (GtkSheet *sheet
,gint row
,gint col
);
Get status of a cell.
a GtkStateType: GTK_SHEET_NORMAL,GTK_SHEET_ROW_SELECTED,GTK_SHEET_COLUMN_SELECTED,GTK_SHEET_RANGE_SELECTED
void gtk_sheet_link_cell (GtkSheet *sheet
,gint row
,gint col
,gpointer link
);
Link pointer to a cell.
gpointer gtk_sheet_get_link (GtkSheet *sheet
,gint row
,gint col
);
Get link pointer from a cell.
void gtk_sheet_remove_link (GtkSheet *sheet
,gint row
,gint col
);
Remove link pointer from a cell.
gboolean gtk_sheet_get_pixel_info (GtkSheet *sheet
,GdkWindow *window
,gint x
,gint y
,gint *row
,gint *column
);
Get row and column correspondig to the given position within the sheet.
In order to decode clicks into to title area correctly, pass the GdkWindow from the button event. Omitting the window (NULL) defaults to the sheet window.
row and column may return values in the range [-1 .. max+1] depending on wether the position lies within the title area, the sheet cell area or beyond the outermost row/column.
All 9 sheet areas can be reliably determined by evaluating the returned row/column values (title area/cell area/outside).
sheet |
a GtkSheet |
|
window |
base window for coordinates (null) |
|
x |
x coordinate |
|
y |
y coordinate |
|
row |
cell row number |
|
column |
cell column number |
gboolean gtk_sheet_get_cell_area (GtkSheet *sheet
,gint row
,gint column
,GdkRectangle *area
);
Get area of a given cell.
sheet |
a GtkSheet |
|
row |
row number |
|
column |
column number |
|
area |
a GdkRectangle area of the cell |
void gtk_sheet_set_row_height (GtkSheet *sheet
,gint row
,guint height
);
Set row height.
void gtk_sheet_add_column (GtkSheet *sheet
,guint ncols
);
Append ncols
columns to the right of the sheet.
void gtk_sheet_add_row (GtkSheet *sheet
,guint nrows
);
Append nrows
rows to the end of the sheet.
void gtk_sheet_insert_rows (GtkSheet *sheet
,guint row
,guint nrows
);
Insert nrows
rows before the given row and pull right.
void gtk_sheet_insert_columns (GtkSheet *sheet
,guint col
,guint ncols
);
Insert ncols
columns before the given row and pull right.
void gtk_sheet_delete_rows (GtkSheet *sheet
,guint row
,guint nrows
);
Delete nrows
rows starting from row
.
void gtk_sheet_delete_columns (GtkSheet *sheet
,guint col
,guint ncols
);
Delete ncols
columns starting from col
.
void gtk_sheet_range_set_background (GtkSheet *sheet
,const GtkSheetRange *urange
,const GdkColor *color
);
Set background color of the given range.
void gtk_sheet_range_set_foreground (GtkSheet *sheet
,const GtkSheetRange *urange
,const GdkColor *color
);
Set foreground color of the given range.
void gtk_sheet_range_set_justification (GtkSheet *sheet
,const GtkSheetRange *urange
,GtkJustification just
);
Set text justification (GTK_JUSTIFY_LEFT, RIGHT, CENTER) of the given range. The default value is GTK_JUSTIFY_LEFT. If autoformat is on, the default justification for numbers is GTK_JUSTIFY_RIGHT.
void gtk_sheet_range_set_editable (GtkSheet *sheet
,const GtkSheetRange *urange
,gint editable
);
Set if cell contents can be edited or not in the given range.
void gtk_sheet_range_set_visible (GtkSheet *sheet
,const GtkSheetRange *urange
,gboolean visible
);
Set if cell contents are visible or not in the given range: accepted values are TRUE or FALSE.
void gtk_sheet_range_set_border (GtkSheet *sheet
,const GtkSheetRange *urange
,gint mask
,guint width
,gint line_style
);
Set cell border style in the given range.
sheet |
a GtkSheet. |
|
urange |
a GtkSheetRange where we set border style. |
|
mask |
CELL_LEFT_BORDER, CELL_RIGHT_BORDER, CELL_TOP_BORDER,CELL_BOTTOM_BORDER |
|
width |
width of the border line in pixels |
|
line_style |
GdkLineStyle for the border line |
void gtk_sheet_range_set_border_color (GtkSheet *sheet
,const GtkSheetRange *urange
,const GdkColor *color
);
Set border color for the given range.
void gtk_sheet_range_set_font (GtkSheet *sheet
,const GtkSheetRange *urange
,PangoFontDescription *font_desc
);
Set font_desc for the given range.
sheet |
a GtkSheet. |
|
urange |
a GtkSheetRange where we set font_desc. |
|
font_desc |
(transfer none) a PangoFontDescription. |
gboolean gtk_sheet_get_attributes (GtkSheet *sheet
,gint row
,gint col
,GtkSheetCellAttr *attributes
);
Gett cell attributes of the given cell.
sheet |
a GtkSheet. |
|
row |
row number |
|
col |
column number |
|
attributes |
GtkSheetCellAttr of the given range |
GtkSheetChild * gtk_sheet_put (GtkSheet *sheet
,GtkWidget *child
,gint x
,gint y
);
Add widgets to the sheet. The widget is floating in one given position (x,y) regardless of the configurations of rows/columns. This means that cells do not resize depending on the widgets' size. You can resize it yourself or use gtk_sheet_attach_*() You may remove it with gtk_container_remove(GTK_CONTAINER(sheet), GtkWidget *child);
sheet |
a GtkSheet. |
|
child |
GtkWidget to be put |
|
x |
x coordinate where we put the widget |
|
y |
y coordinate where we put the widget |
void gtk_sheet_attach_floating (GtkSheet *sheet
,GtkWidget *widget
,gint row
,gint col
);
The widget is attached to the top-left corner of a cell (row,column) and moves with it when you change width, height, or you delete of add row/columns
void gtk_sheet_attach_default (GtkSheet *sheet
,GtkWidget *widget
,gint row
,gint col
);
Attaches a child widget to the given cell with the 0,0 alignments.
Works basically like gtk_table_attach, with the same options, the widget is confined in the cell, and whether it fills the
cell, expands with it, or shrinks with it, depending on the options.
The child is reallocated each time the column or row changes, keeping attached to the same cell.
It's in fact gtk_sheet_attach()
with GTK_EXPAND set.
void gtk_sheet_attach (GtkSheet *sheet
,GtkWidget *widget
,gint row
,gint col
,gint xoptions
,gint yoptions
,gint xpadding
,gint ypadding
);
Attaches a child widget to the given cell with the given alignments. Works basically like gtk_table_attach, with the same options, the widget is confined in the cell, and whether it fills the cell, expands with it, or shrinks with it, depending on the options , if GTK_EXPAND is set. The child is reallocated each time the column or row changes, keeping attached to the same cell.
void gtk_sheet_move_child (GtkSheet *sheet
,GtkWidget *widget
,gint x
,gint y
);
Move widgets added with gtk_sheet_put()
in the sheet.
const GtkSheetChild * gtk_sheet_get_child_at (GtkSheet *sheet
,gint row
,gint col
);
Get the child attached at row
,col
.
void gtk_sheet_button_attach (GtkSheet *sheet
,GtkWidget *widget
,gint row
,gint col
);
Button attach works like cell attach but for the buttons.
Subset of GtkEditable Widgets to allow selecting a widget from glade-3
struct GtkSheetChild { };
The GtkSheetChild struct contains only private data. It should only be accessed through the functions described below.
struct GtkSheetButton { };
The GtkSheetButton struct contains only private data. It should only be accessed through the functions described below.
struct GtkSheetCellBorder { };
The GtkSheetCellBorder struct contains only private data. It should only be accessed through the functions described below.
struct GtkSheetCellAttr { };
The GtkSheetCellAttr struct contains only private data. It should only be accessed through the functions described below.
struct GtkSheetCell { };
The GtkSheetCell struct contains only private data. It should only be accessed through the functions described below.
struct GtkSheetRange { gint row0,col0; /* upper-left cell */ gint rowi,coli; /* lower-right cell */ };
Defines a rectangular range of cells.
struct GtkSheetRow { };
The GtkSheetRow struct contains only private data. It should only be accessed through the functions described below.
struct GtkSheet;
The GtkSheet struct contains only private data. It should only be accessed through the functions described below.
typedef struct _GtkSheetColumn GtkSheetColumn;
The GtkSheetColumn struct contains only private data. It should only be accessed through the functions described below.
“autoresize”
property“autoresize” gboolean
Autoreisize cells while typing (rows and columns)
GtkSheet:autoresize
has been deprecated since version 3.0 and should not be used in newly-written code.
use autoresize-rows, autoresize-columns instead
Flags: Read / Write
Default value: FALSE
“autoresize-cols”
property“autoresize-cols” gboolean
Autoreisize columns while typing
Flags: Read / Write
Default value: FALSE
“autoresize-rows”
property“autoresize-rows” gboolean
Autoreisize rows while typing
Flags: Read / Write
Default value: FALSE
“autoscroll”
property“autoscroll” gboolean
The sheet will be automatically scrolled when you move beyond the last visible row/column
Flags: Read / Write
Default value: TRUE
“clip-text”
property“clip-text” gboolean
Clip text in cells
Flags: Read / Write
Default value: FALSE
“col-titles-height”
property“col-titles-height” guint
Height of the column titles
Flags: Read / Write
Allowed values: <= 1024
Default value: 24
“col-titles-visible”
property“col-titles-visible” gboolean
Visibility of the column titles
Flags: Read / Write
Default value: TRUE
“columns-resizable”
property“columns-resizable” gboolean
Columns resizable
Flags: Read / Write
Default value: TRUE
“description”
property“description” gchar *
The sheets description, a place to store further information for application use
Flags: Read / Write
Default value: ""
“entry-type”
property“entry-type” GtkSheetEntryType
Sheet cell entry widget type
Flags: Read / Write
Default value: GTK_SHEET_ENTRY_TYPE_DEFAULT
“grid-visible”
property“grid-visible” gboolean
Sets the visibility of grid
Flags: Read / Write
Default value: TRUE
“justify-entry”
property“justify-entry” gboolean
Adapt cell entry editor to the cell justification.
Flags: Read / Write
Default value: TRUE
“locked”
property“locked” gboolean
If the sheet ist locked, it is not editable, cell contents cannot be modified by the user.
Flags: Read / Write
Default value: FALSE
“n-rows”
property“n-rows” gint
Number of rows in the sheet
Flags: Read / Write
Allowed values: [0,1000000]
Default value: 0
“row-titles-visible”
property“row-titles-visible” gboolean
Row titles visible
Flags: Read / Write
Default value: TRUE
“row-titles-width”
property“row-titles-width” guint
Width of the row title area
Flags: Read / Write
Allowed values: <= 2048
Default value: 80
“rows-resizable”
property“rows-resizable” gboolean
Rows resizable
Flags: Read / Write
Default value: TRUE
“selection-mode”
property“selection-mode” GtkSelectionMode
Sets the selection mode of the cells in a GtkSheet
Flags: Read / Write
Default value: GTK_SELECTION_BROWSE
“title”
property“title” gchar *
The sheets title string
Flags: Read / Write
Default value: "GtkSheet"
“traverse-type”
property“traverse-type” GtkSheetTraverseType
Default sheet traversal type.
Flags: Read / Write
Default value: GTK_SHEET_TRAVERSE_ALL
“vjust”
property“vjust” GtkSheetVerticalJustification
Default vertical cell text justification
Flags: Read / Write
Default value: GTK_SHEET_VERTICAL_JUSTIFICATION_TOP
“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: ""
“datatype”
property“datatype” gchar *
no functionality, a datatype hint for the application because any widget content is text
Flags: Read / Write
Default value: ""
“description”
property“description” gchar *
Description of column contents
Flags: Read / Write
Default value: ""
“entry-type”
property“entry-type” GtkSheetEntryType
Column cell entry widget type
Flags: Read / Write
Default value: GTK_SHEET_ENTRY_TYPE_DEFAULT
“justification”
property“justification” GtkJustification
Justification of the column
Flags: Read / Write
Default value: GTK_JUSTIFY_LEFT
“label”
property“label” gchar *
Label of the column button
Flags: Read / Write
Default value: ""
“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
“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
“position”
property“position” gint
The packing position of the column
Flags: Read / Write
Allowed values: [0,1024]
Default value: 0
“readonly”
property“readonly” gboolean
Lock column contents for editing.
Flags: Read / Write
Default value: FALSE
“visible”
property“visible” gboolean
Visible property for columns
Flags: Read / Write
Default value: TRUE
“vjust”
property“vjust” GtkSheetVerticalJustification
Column vertical cell text justification
Flags: Read / Write
Default value: GTK_SHEET_VERTICAL_JUSTIFICATION_DEFAULT
“width”
property“width” gint
Width of the column
Flags: Read / Write
Allowed values: [-1,8192]
Default value: -1
“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
“activate”
signalgboolean user_function (GtkSheet *sheet, gint row, gint column, gpointer user_data)
Emmited whenever a cell is activated(you click on it).
FIXME:: The return value is ignored (not yet implemented).
sheet |
the sheet widget that emitted the signal |
|
row |
row number of activated cell. |
|
column |
column number of activated cell. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“changed”
signalvoid user_function (GtkSheet *sheet, gint row, gint column, gpointer user_data)
"Emited when typing into the active cell, changing its content. It is emitted after each key press in cell and after deactivating cell.
sheet |
the sheet widget that emitted the signal |
|
row |
row number of changed cell. |
|
column |
column number of changed cell. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“clear-cell”
signalvoid user_function (GtkSheet *sheet, gint row, gint column, gpointer user_data)
Emited when when the content of the cell is erased.
sheet |
the sheet widget that emitted the signal |
|
row |
row number of cleared cell. |
|
column |
column number of cleared cell. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“clip-range”
signalvoid user_function (GtkSheet *sheet, GtkSheetRange *clip_range, gpointer user_data)
Emmited when a GtkSheetRange is clipping.
sheet |
the sheet widget that emitted the signal |
|
clip_range |
the newly selected GtkSheetRange |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“deactivate”
signalgboolean user_function (GtkSheet *sheet, gint row, gint column, gpointer user_data)
Emmited whenever a cell is deactivated(you click on other cell or start a new selection).
The signal handler must return TRUE in order to allow deactivation, FALSE to deny deactivation.
sheet |
the sheet widget that emitted the signal |
|
row |
row number of deactivated cell. |
|
column |
column number of deactivated cell. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“enter-pressed”
signalgboolean user_function (GtkSheet *sheet, GdkEvent *event, gpointer user_data)
This signal intercepts RETURN and ENTER key-press-events before they are processed by the sheet-entry editor. Any modifier combinations on these keys may trigger the signal.
The default behaviour of the sheet-entry editor is to move the active cell, which might not be appropriate for the type of application.
sheet |
the sheet widget that emitted the signal |
|
event |
the GdkEventKey which triggered this signal. |
[type Gdk.EventKey] |
user_data |
user data set when the signal handler was connected. |
TRUE
to block the sheet-entry from processing
the event. FALSE
to propagate the event to the
sheet-entry.
Flags: Run Last
“entry-focus-in”
signalgboolean user_function (GtkSheet *sheet, GdkEvent *event, gpointer user_data)
The ::entry-focus-in signal will be emitted when the keyboard focus enters the sheet_entry editor.
sheet |
the sheet widget that emitted the signal |
|
event |
the GdkEventFocus which triggered this signal |
|
user_data |
user data set when the signal handler was connected. |
TRUE
to stop other handlers from being invoked for the event.
FALSE
to propagate the event further.
Flags: Run Last
Since: 3.0.1
“entry-focus-out”
signalgboolean user_function (GtkSheet *sheet, GdkEvent *event, gpointer user_data)
The ::entry-focus-out signal will be emitted when the keyboard focus leaves the sheet_entry editor.
sheet |
the sheet widget that emitted the signal |
|
event |
the GdkEventFocus which triggered this signal |
|
user_data |
user data set when the signal handler was connected. |
TRUE
to stop other handlers from being invoked for the event.
FALSE
to propagate the event further.
Flags: Run Last
Since: 3.0.1
“move-cursor”
signalvoid user_function (GtkSheet *sheet, GtkMovementStep step, gint count, gboolean extend_selection, gpointer user_data)
The ::move-cursor signal is a keybinding signal which gets emitted when the user initiates a cursor movement.
Applications should not connect to it, but may emit it with
g_signal_emit_by_name()
if they need to control the cursor
programmatically.
sheet |
the sheet widget that emitted the signal |
|
step |
the granularity of the move, as a GtkMovementStep |
|
count |
the number of |
|
extend_selection |
|
|
user_data |
user data set when the signal handler was connected. |
Flags: Action
Since: 3.0.2
“move-range”
signalvoid user_function (GtkSheet *sheet, GtkSheetRange *old_range, GtkSheetRange *new_range, gpointer user_data)
Emmited when a GtkSheetRange is moved.
sheet |
the sheet widget that emitted the signal. |
|
old_range |
the previous selected GtkSheetRange. |
|
new_range |
the newly selected GtkSheetRange. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“new-column-width”
signalvoid user_function (GtkSheet *sheet, gint col, gint width, gpointer user_data)
Emited when the width of a column is modified.
sheet |
the sheet widget that emitted the signal |
|
col |
modified column number. |
|
width |
new column width |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“new-row-height”
signalvoid user_function (GtkSheet *sheet, gint row, gint height, gpointer user_data)
Emited when the height of a row is modified.
sheet |
the sheet widget that emitted the signal |
|
row |
modified row number. |
|
height |
new row height. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“populate-popup”
signalvoid user_function (GtkSheet *sheet, GtkMenu *menu, gpointer user_data)
The ::populate-popup signal will be emitted when the user activates the popup menu of the sheet_entry editor.
The emission of this signal is only supported for GtkEntry, GtkDataEntry, GtkItemEntry and GtkTextView.
sheet |
the sheet widget that emitted the signal |
|
menu |
the menu that ist being populated |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 3.0.1
“resize-range”
signalvoid user_function (GtkSheet *sheet, GtkSheetRange *old_range, GtkSheetRange *new_range, gpointer user_data)
Emmited when a GtkSheetRange is resized.
sheet |
the sheet widget that emitted the signal |
|
old_range |
the previous selected GtkSheetRange. |
|
new_range |
the newly selected GtkSheetRange. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“select-column”
signalvoid user_function (GtkSheet *sheet, gint select_column, gpointer user_data)
Emmited when a column has been selected.
sheet |
the sheet widget that emitted the signal |
|
select_column |
the newly selected column index |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“select-range”
signalvoid user_function (GtkSheet *sheet, GtkSheetRange *select_range, gpointer user_data)
Emmited when a GtkSheetRange has been selected.
sheet |
the sheet widget that emitted the signal |
|
select_range |
the newly selected GtkSheetRange |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“select-row”
signalvoid user_function (GtkSheet *sheet, gint row, gpointer user_data)
Emmited when a row has been selected.
sheet |
the sheet widget that emitted the signal |
|
row |
the newly selected row index |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“set-cell”
signalvoid user_function (GtkSheet *sheet, gint row, gint column, gpointer user_data)
Emited when clicking on a non-empty cell.
sheet |
the sheet widget that emitted the signal |
|
row |
row number of activated cell. |
|
column |
column number of activated cell. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“set-scroll-adjustments”
signalvoid user_function (GtkSheet *sheet, GtkAdjustment *hadjustment, GtkAdjustment *vadjustment, gpointer user_data)
Emited when scroll adjustments are set.
sheet |
the sheet widget that emitted the signal |
|
hadjustment |
horizontal GtkAdjustment. |
|
vadjustment |
vertical GtkAdkjustment. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“traverse”
signalgboolean user_function (GtkSheet *sheet, gint row, gint column, gpointer *new_row, gpointer *new_column, gpointer user_data)
The "traverse" is emited before "deactivate" and allows to veto the movement. In such case, the entry will remain in the site and the other signals will not be emited.
The signal handler must return TRUE to allow the movement, FALSE to veto the movement.
sheet |
the sheet widget that emitted the signal. |
|
row |
row number of old cell |
|
column |
column number of old cell |
|
*new_row |
row number of target cell, changeable |
|
*new_column |
column number of target cell, changeable |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last