TableProtocol

public protocol TableProtocol : ContainerProtocol

The GtkTable functions allow the programmer to arrange widgets in rows and columns, making it easy to align many widgets next to each other, horizontally and vertically.

Tables are created with a call to gtk_table_new(), the size of which can later be changed with gtk_table_resize().

Widgets can be added to a table using gtk_table_attach() or the more convenient (but slightly less flexible) gtk_table_attach_defaults().

To alter the space next to a specific row, use gtk_table_set_row_spacing(), and for a column, gtk_table_set_col_spacing(). The gaps between all rows or columns can be changed by calling gtk_table_set_row_spacings() or gtk_table_set_col_spacings() respectively. Note that spacing is added between the children, while padding added by gtk_table_attach() is added on either side of the widget it belongs to.

gtk_table_set_homogeneous(), can be used to set whether all cells in the table will resize themselves to the size of the largest widget in the table.

> GtkTable has been deprecated. Use GtkGrid instead. It provides the same > capabilities as GtkTable for arranging widgets in a rectangular grid, but > does support height-for-width geometry management.

The TableProtocol protocol exposes the methods and properties of an underlying GtkTable instance. The default implementation of these can be found in the protocol extension below. For a concrete class that implements these methods and properties, see Table. Alternatively, use TableRef as a lighweight, unowned reference if you already have an instance you just want to use.

  • ptr

    Untyped pointer to the underlying GtkTable instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • table_ptr Default implementation

    Typed pointer to the underlying GtkTable instance.

    Default Implementation

    Return the stored, untyped pointer as a typed pointer to the GtkTable instance.

    Declaration

    Swift

    var table_ptr: UnsafeMutablePointer<GtkTable>! { get }
  • Required Initialiser for types conforming to TableProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

Table Class

  • Bind a TablePropertyName source property to a given target object.

    Declaration

    Swift

    @discardableResult
    @inlinable
    func bind<Q, T>(property source_property: TablePropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocol

    Parameters

    source_property

    the source property to bind

    target

    the target object to bind to

    target_property

    the target property to bind to

    flags

    the flags to pass to the Binding

    transform_from

    ValueTransformer to use for forward transformation

    transform_to

    ValueTransformer to use for backwards transformation

    Return Value

    binding reference or nil in case of an error

  • get(property:) Extension method

    Get the value of a Table property

    Declaration

    Swift

    @inlinable
    func get(property: TablePropertyName) -> GLibObject.Value

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

  • set(property:value:) Extension method

    Set the value of a Table property. Note that this will only have an effect on properties that are writable and not construct-only!

    Declaration

    Swift

    @inlinable
    func set(property: TablePropertyName, value v: GLibObject.Value)

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

Table Class: TableProtocol extension (methods and fields)

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

    attach is deprecated: Use gtk_grid_attach() with #GtkGrid. Note that the attach arguments differ between those two functions.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func attach<WidgetT>(child: WidgetT, leftAttach: Int, rightAttach: Int, topAttach: Int, bottomAttach: Int, xoptions: AttachOptions, yoptions: AttachOptions, xpadding: Int, ypadding: Int) where WidgetT : WidgetProtocol
  • 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 GtkAttachOptions are GTK_EXPAND | GTK_FILL, and the padding is set to 0.

    attach_defaults is deprecated: Use gtk_grid_attach() with #GtkGrid. Note that the attach arguments differ between those two functions.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func attachDefaults<WidgetT>(widget: WidgetT, leftAttach: Int, rightAttach: Int, topAttach: Int, bottomAttach: Int) where WidgetT : WidgetProtocol
  • getColSpacing(column:) Extension method

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

    get_col_spacing is deprecated:

    GtkGrid does not offer a replacement for this

    functionality.
    

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func getColSpacing(column: Int) -> Int
  • getDefaultColSpacing() Extension method

    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())

    get_default_col_spacing is deprecated: Use gtk_grid_get_column_spacing() with #GtkGrid.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func getDefaultColSpacing() -> Int
  • getDefaultRowSpacing() Extension method

    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())

    get_default_row_spacing is deprecated: Use gtk_grid_get_row_spacing() with #GtkGrid.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func getDefaultRowSpacing() -> Int
  • getHomogeneous() Extension method

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

    get_homogeneous is deprecated: Use gtk_grid_get_row_homogeneous() and gtk_grid_get_column_homogeneous() with #GtkGrid.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func getHomogeneous() -> Bool
  • getRowSpacing(row:) Extension method

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

    get_row_spacing is deprecated:

    GtkGrid does not offer a replacement for this

    functionality.
    

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func getRowSpacing(row: Int) -> Int
  • getSize(rows:columns:) Extension method

    Gets the number of rows and columns in the table.

    get_size is deprecated:

    GtkGrid does not expose the number of columns and

    rows.
    

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func getSize(rows: UnsafeMutablePointer<guint>! = nil, columns: UnsafeMutablePointer<guint>! = nil)
  • resize(rows:columns:) Extension method

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

    resize is deprecated:

    GtkGrid resizes automatically.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func resize(rows: Int, columns: Int)
  • Alters the amount of space between a given table column and the following column.

    set_col_spacing is deprecated: Use gtk_widget_set_margin_start() and gtk_widget_set_margin_end() on the widgets contained in the row if you need this functionality. #GtkGrid does not support per-row spacing.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func setColSpacing(column: Int, spacing: Int)
  • setColSpacings(spacing:) Extension method

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

    set_col_spacings is deprecated: Use gtk_grid_set_column_spacing() with #GtkGrid.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func setColSpacings(spacing: Int)
  • set(homogeneous:) Extension method

    Changes the homogenous property of table cells, ie. whether all cells are an equal size or not.

    set_homogeneous is deprecated: Use gtk_grid_set_row_homogeneous() and gtk_grid_set_column_homogeneous() with #GtkGrid.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func set(homogeneous: Bool)
  • setRowSpacing(row:spacing:) Extension method

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

    set_row_spacing is deprecated: Use gtk_widget_set_margin_top() and gtk_widget_set_margin_bottom() on the widgets contained in the row if you need this functionality. #GtkGrid does not support per-row spacing.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func setRowSpacing(row: Int, spacing: Int)
  • setRowSpacings(spacing:) Extension method

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

    set_row_spacings is deprecated: Use gtk_grid_set_row_spacing() with #GtkGrid.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func setRowSpacings(spacing: Int)
  • defaultColSpacing Extension method

    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())

    get_default_col_spacing is deprecated: Use gtk_grid_get_column_spacing() with #GtkGrid.

    Declaration

    Swift

    @inlinable
    var defaultColSpacing: Int { get }
  • defaultRowSpacing Extension method

    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())

    get_default_row_spacing is deprecated: Use gtk_grid_get_row_spacing() with #GtkGrid.

    Declaration

    Swift

    @inlinable
    var defaultRowSpacing: Int { get }
  • homogeneous Extension method

    Undocumented

    Declaration

    Swift

    @inlinable
    var homogeneous: Bool { get nonmutating set }
  • container Extension method

    Undocumented

    Declaration

    Swift

    @inlinable
    var container: GtkContainer { get }