Class: Gtk::Table

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Instance Method Details

#attach(child, left_attach, right_attach, top_attach, bottom_attach, xoptions, yoptions, xpadding, ypadding) ⇒ nil

Adds a widget to a table. The number of “cells” that a widget will occupy is specified by left_attach, right_attach, top_attach and bottom_attach. These each represent the leftmost, rightmost, uppermost and lowest column and row numbers of the table. (Columns and rows are indexed from zero).

To make a button occupy the lower right cell of a 2x2 table, use |[ gtk_table_attach (table, button,

1, 2, // left, right attach
1, 2, // top, bottom attach
xoptions, yoptions,
xpadding, ypadding);

]| If you want to make the button span the entire bottom row, use left_attach == 0 and right_attach = 2 instead.

Parameters:

  • child (Gtk::Widget)

    The widget to add.

  • left_attach (Integer)

    the column number to attach the left side of a child widget to.

  • right_attach (Integer)

    the column number to attach the right side of a child widget to.

  • top_attach (Integer)

    the row number to attach the top of a child widget to.

  • bottom_attach (Integer)

    the row number to attach the bottom of a child widget to.

  • xoptions (Gtk::AttachOptions)

    Used to specify the properties of the child widget when the table is resized.

  • yoptions (Gtk::AttachOptions)

    The same as xoptions, except this field determines behaviour of vertical resizing.

  • xpadding (Integer)

    An integer value specifying the padding on the left and right of the widget being added to the table.

  • ypadding (Integer)

    The amount of padding above and below the child widget.

Returns:

  • (nil)

#attach_defaults(widget, left_attach, right_attach, top_attach, bottom_attach) ⇒ nil

As there are many options associated with gtk_table_attach(), this convenience function provides the programmer with a means to add children to a table with identical padding and expansion options. The values used for the Gtk::AttachOptions are ‘GTK_EXPAND | GTK_FILL`, and the padding is set to 0.

Parameters:

  • widget (Gtk::Widget)

    The child widget to add.

  • left_attach (Integer)

    The column number to attach the left side of the child widget to.

  • right_attach (Integer)

    The column number to attach the right side of the child widget to.

  • top_attach (Integer)

    The row number to attach the top of the child widget to.

  • bottom_attach (Integer)

    The row number to attach the bottom of the child widget to.

Returns:

  • (nil)

#col_spacings=(spacing) ⇒ nil

Sets the space between every column in table equal to spacing.

Parameters:

  • spacing (Integer)

    the number of pixels of space to place between every column in the table.

Returns:

  • (nil)

#column_spacingInteger

Returns column-spacing.

Returns:

  • (Integer)

    column-spacing

#column_spacing=(column_spacing) ⇒ Integer

Parameters:

  • column_spacing (Integer)

Returns:

  • (Integer)

    column-spacing

  • (Integer)

    column-spacing

#default_col_spacingInteger

Gets the default column spacing for the table. This is the spacing that will be used for newly added columns. (See gtk_table_set_col_spacings())

Returns:

  • (Integer)

    the default column spacing

#default_row_spacingInteger

Gets the default row spacing for the table. This is the spacing that will be used for newly added rows. (See gtk_table_set_row_spacings())

Returns:

  • (Integer)

    the default row spacing

#get_col_spacing(column) ⇒ Integer

Gets the amount of space between column col, and column col + 1. See gtk_table_set_col_spacing().

Parameters:

  • column (Integer)

    a column in the table, 0 indicates the first column

Returns:

  • (Integer)

    the column spacing

#get_row_spacing(row) ⇒ Integer

Gets the amount of space between row row, and row row + 1. See gtk_table_set_row_spacing().

Parameters:

  • row (Integer)

    a row in the table, 0 indicates the first row

Returns:

  • (Integer)

    the row spacing

#get_size(rows, columns) ⇒ nil

Gets the number of rows and columns in the table.

Parameters:

  • rows (Integer)

    return location for the number of rows, or nil

  • columns (Integer)

    return location for the number of columns, or nil

Returns:

  • (nil)

#homogeneousTrueClass

Returns whether the table cells are all constrained to the same width and height. (See gtk_table_set_homogeneous ())

Returns:

  • (TrueClass)

    true if the cells are all constrained to the same size

#homogeneous=(homogeneous) ⇒ TrueClass

Parameters:

  • homogeneous (TrueClass)

Returns:

  • (TrueClass)

    homogeneous

  • (TrueClass)

    homogeneous

#homogeneous?TrueClass

Returns homogeneous.

Returns:

  • (TrueClass)

    homogeneous

#n_columnsInteger

Returns n-columns.

Returns:

  • (Integer)

    n-columns

#n_columns=(n_columns) ⇒ Integer

Parameters:

  • n_columns (Integer)

Returns:

  • (Integer)

    n-columns

  • (Integer)

    n-columns

#n_rowsInteger

Returns n-rows.

Returns:

  • (Integer)

    n-rows

#n_rows=(n_rows) ⇒ Integer

Parameters:

  • n_rows (Integer)

Returns:

  • (Integer)

    n-rows

  • (Integer)

    n-rows

#new(rows, columns, homogeneous) ⇒ Gtk::Widget

Used to create a new table widget. An initial size must be given by specifying how many rows and columns the table should have, although this can be changed later with gtk_table_resize(). rows and columns must both be in the range 1 .. 65535. For historical reasons, 0 is accepted as well and is silently interpreted as 1.

Parameters:

  • rows (Integer)

    The number of rows the new table should have.

  • columns (Integer)

    The number of columns the new table should have.

  • homogeneous (TrueClass)

    If set to true, all table cells are resized to the size of the cell containing the largest widget.

Returns:

  • (Gtk::Widget)

    A pointer to the newly created table widget.

#resize(rows, columns) ⇒ nil

If you need to change a table’s size after it has been created, this function allows you to do so.

Parameters:

  • rows (Integer)

    The new number of rows.

  • columns (Integer)

    The new number of columns.

Returns:

  • (nil)

#row_spacingInteger

Returns row-spacing.

Returns:

  • (Integer)

    row-spacing

#row_spacing=(row_spacing) ⇒ Integer

Parameters:

  • row_spacing (Integer)

Returns:

  • (Integer)

    row-spacing

  • (Integer)

    row-spacing

#row_spacings=(spacing) ⇒ nil

Sets the space between every row in table equal to spacing.

Parameters:

  • spacing (Integer)

    the number of pixels of space to place between every row in the table.

Returns:

  • (nil)

#set_col_spacing(column, spacing) ⇒ nil

Alters the amount of space between a given table column and the following column.

Parameters:

  • column (Integer)

    the column whose spacing should be changed.

  • spacing (Integer)

    number of pixels that the spacing should take up.

Returns:

  • (nil)

#set_row_spacing(row, spacing) ⇒ nil

Changes the space between a given table row and the subsequent row.

Parameters:

  • row (Integer)

    row number whose spacing will be changed.

  • spacing (Integer)

    number of pixels that the spacing should take up.

Returns:

  • (nil)