Class: Gtk::Grid

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

Instance Method Summary collapse

Instance Method Details

#attach(child, left, top, width, height) ⇒ nil

Adds a widget to the grid.

The position of child is determined by left and top. The number of “cells” that child will occupy is determined by width and height.

Parameters:

  • child (Gtk::Widget)

    the widget to add

  • left (Integer)

    the column number to attach the left side of child to

  • top (Integer)

    the row number to attach the top side of child to

  • width (Integer)

    the number of columns that child will span

  • height (Integer)

    the number of rows that child will span

Returns:

  • (nil)

#attach_next_to(child, sibling, side, width, height) ⇒ nil

Adds a widget to the grid.

The widget is placed next to sibling, on the side determined by side. When sibling is nil, the widget is placed in row (for left or right placement) or column 0 (for top or bottom placement), at the end indicated by side.

Attaching widgets labeled [1], [2], [3] with sibling == nil and side == %GTK_POS_LEFT yields a layout of [3][1].

Parameters:

  • child (Gtk::Widget)

    the widget to add

  • sibling (Gtk::Widget)

    the child of grid that child will be placed next to, or nil to place child at the beginning or end

  • side (Gtk::PositionType)

    the side of sibling that child is positioned next to

  • width (Integer)

    the number of columns that child will span

  • height (Integer)

    the number of rows that child will span

Returns:

  • (nil)

#baseline_rowInteger

Returns baseline-row.

Returns:

  • (Integer)

    baseline-row

#baseline_row=(baseline_row) ⇒ Integer

Parameters:

  • baseline_row (Integer)

Returns:

  • (Integer)

    baseline-row

  • (Integer)

    baseline-row

#column_homogeneousTrueClass

Returns whether all columns of grid have the same width.

Returns:

  • (TrueClass)

    whether all columns of grid have the same width.

#column_homogeneous=(column_homogeneous) ⇒ TrueClass

Parameters:

  • column_homogeneous (TrueClass)

Returns:

  • (TrueClass)

    column-homogeneous

  • (TrueClass)

    column-homogeneous

#column_homogeneous?TrueClass

Returns column-homogeneous.

Returns:

  • (TrueClass)

    column-homogeneous

#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

#get_child_at(left, top) ⇒ Gtk::Widget

Gets the child of grid whose area covers the grid cell whose upper left corner is at left, top.

Parameters:

  • left (Integer)

    the left edge of the cell

  • top (Integer)

    the top edge of the cell

Returns:

  • (Gtk::Widget)

    the child at the given position, or nil

#get_row_baseline_position(row) ⇒ Gtk::BaselinePosition

Returns the baseline position of row as set by gtk_grid_set_row_baseline_position() or the default value %GTK_BASELINE_POSITION_CENTER.

Parameters:

  • row (Integer)

    a row index

Returns:

#insert_column(position) ⇒ nil

Inserts a column at the specified position.

Children which are attached at or to the right of this position are moved one column to the right. Children which span across this position are grown to span the new column.

Parameters:

  • position (Integer)

    the position to insert the column at

Returns:

  • (nil)

#insert_next_to(sibling, side) ⇒ nil

Inserts a row or column at the specified position.

The new row or column is placed next to sibling, on the side determined by side. If side is %GTK_POS_TOP or %GTK_POS_BOTTOM, a row is inserted. If side is %GTK_POS_LEFT of %GTK_POS_RIGHT, a column is inserted.

Parameters:

  • sibling (Gtk::Widget)

    the child of grid that the new row or column will be placed next to

  • side (Gtk::PositionType)

    the side of sibling that child is positioned next to

Returns:

  • (nil)

#insert_row(position) ⇒ nil

Inserts a row at the specified position.

Children which are attached at or below this position are moved one row down. Children which span across this position are grown to span the new row.

Parameters:

  • position (Integer)

    the position to insert the row at

Returns:

  • (nil)

#newGtk::Widget

Creates a new grid widget.

Returns:

#remove_column(position) ⇒ nil

Removes a column from the grid.

Children that are placed in this column are removed, spanning children that overlap this column have their width reduced by one, and children after the column are moved to the left.

Parameters:

  • position (Integer)

    the position of the column to remove

Returns:

  • (nil)

#remove_row(position) ⇒ nil

Removes a row from the grid.

Children that are placed in this row are removed, spanning children that overlap this row have their height reduced by one, and children below the row are moved up.

Parameters:

  • position (Integer)

    the position of the row to remove

Returns:

  • (nil)

#row_homogeneousTrueClass

Returns whether all rows of grid have the same height.

Returns:

  • (TrueClass)

    whether all rows of grid have the same height.

#row_homogeneous=(row_homogeneous) ⇒ TrueClass

Parameters:

  • row_homogeneous (TrueClass)

Returns:

  • (TrueClass)

    row-homogeneous

  • (TrueClass)

    row-homogeneous

#row_homogeneous?TrueClass

Returns row-homogeneous.

Returns:

  • (TrueClass)

    row-homogeneous

#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

#set_row_baseline_position(row, pos) ⇒ nil

Sets how the baseline should be positioned on row of the grid, in case that row is assigned more space than is requested.

Parameters:

Returns:

  • (nil)