IdeGrid: Builder SDK Reference

## IdeGrid IdeGrid — A grid for IdePage |

## Functions

GtkWidget * | ide_grid_new ()
IdeGridColumn * | ide_grid_get_nth_column ()
IdePage * | ide_grid_focus_neighbor ()
IdeGridColumn * | ide_grid_get_current_column ()
void | ide_grid_set_current_column ()
IdeFrame * | ide_grid_get_current_stack ()
IdePage * | ide_grid_get_current_page ()
guint | ide_grid_count_pages ()
void | ide_grid_foreach_page ()

## Properties

IdeGridColumn * | current-column | Read / Write
IdePage * | current-page | Read
IdeFrame * | current-stack | Read

## Signals

IdeFrame* | create-frame | Run Last
IdePage* | create-page | Run Last

## Types and Values

#define | IDE_TYPE_GRID
struct | IdeGridClass
| IdeGrid

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── DzlMultiPaned
                        ╰── IdeGrid

## Implemented Interfaces

IdeGrid implements AtkImplementorIface, GtkBuildable, GtkOrientable and GListModel.

## Description

The IdeGrid provides a grid of pages that the user may manipulate.

Internally, this is implemented with IdeGrid at the top containing one or more of IdeGridColumn. Those columns contain one or more IdeFrame. The stack can contain many IdePage.

IdeGrid implements the GListModel interface to simplify the process of listing (with deduplication) the pages that are contianed within the IdeGrid. If you would instead like to see all possible pages in the stack, use the `ide_grid_foreach_page()` API.

## Functions

### ide_grid_new ()

    GtkWidget *
    ide_grid_new (void);

Creates a new IdeGrid.

#### Returns

A newly created IdeGrid.

[transfer full]

Since: 3.32

### ide_grid_get_nth_column ()

    IdeGridColumn *
    ide_grid_get_nth_column (IdeGrid *self,
                             gint nth);

Gets the `nth` column from the grid.

If `nth` is -1, then a new column at the beginning of the grid is created.

If `nth` is >= the number of columns in the grid, then a new column at the end of the grid is created.

#### Parameters

self | a IdeGrid |
nth | the index of the column, or -1 |

#### Returns

An IdeGridColumn.

[transfer none]

Since: 3.32

### ide_grid_focus_neighbor ()

    IdePage *
    ide_grid_focus_neighbor (IdeGrid *self,
                             GtkDirectionType dir);

Attempts to focus a neighbor IdePage in the grid based on the direction requested.

If an IdePage was focused, it will be returned to the caller.

#### Parameters

self | An IdeGrid |
dir | the direction for the focus change |

#### Returns

An IdePage or `NULL`.

[transfer none][nullable]

Since: 3.32

### ide_grid_get_current_column ()

    IdeGridColumn *
    ide_grid_get_current_column (IdeGrid *self);

Gets the most recently focused column of the grid.

#### Parameters

self | a IdeGrid |

#### Returns

An IdeGridColumn.

[transfer none][not nullable]

Since: 3.32

### ide_grid_set_current_column ()

    void
    ide_grid_set_current_column (IdeGrid *self,
                                 IdeGridColumn *column);

Sets the current column for the grid. Generally this is automatically updated for you when the focus changes within the workbench.

`column` can be `NULL` out of convenience.

#### Parameters

self | an IdeGrid |
column | an IdeGridColumn or `NULL`. | [nullable]

Since: 3.32

### ide_grid_get_current_stack ()

    IdeFrame *
    ide_grid_get_current_stack (IdeGrid *self);

Gets the most recently focused stack. This is useful when you want to open a document on the stack the user last focused.

#### Parameters

self | a IdeGrid |

#### Returns

an IdeFrame or `NULL`.

[transfer none][nullable]

Since: 3.32

### ide_grid_get_current_page ()

    IdePage *
    ide_grid_get_current_page (IdeGrid *self);

Gets the most recent page used by the user as determined by tracking the window focus.

#### Parameters

self | a IdeGrid |

#### Returns

An IdePage or `NULL`.

[transfer none]

Since: 3.32

### ide_grid_count_pages ()

    guint
    ide_grid_count_pages (IdeGrid *self);

### ide_grid_foreach_page ()

    void
    ide_grid_foreach_page (IdeGrid *self,
                           GtkCallback callback,
                           gpointer user_data);

This function will call `callback` for every page found in `self` .

#### Parameters

self | a IdeGrid |
callback | A callback for each page. | [scope call][closure user_data]
user_data | user data for `callback` |

Since: 3.32

## Types and Values

### IDE_TYPE_GRID

    #define IDE_TYPE_GRID (ide_grid_get_type())

### struct IdeGridClass

    struct IdeGridClass {
      DzlMultiPanedClass parent_class;

      IdeFrame *(*create_frame) (IdeGrid     *self);
      IdePage  *(*create_page)  (IdeGrid     *self,
                                 const gchar *uri);
    };

### IdeGrid

    typedef struct _IdeGrid IdeGrid;

## Property Details

### The `“current-column”` property

      “current-column”           IdeGridColumn *

The most recently focused grid column.

Owner: IdeGrid

Flags: Read / Write

### The `“current-page”` property

      “current-page”             IdePage *

The most recently focused IdePage.

Owner: IdeGrid

Flags: Read

### The `“current-stack”` property

      “current-stack”            IdeFrame *

The most recently focused IdeFrame.

Owner: IdeGrid

Flags: Read

## Signal Details

### The `“create-frame”` signal

    IdeFrame*
    user_function (IdeGrid *self,
                   gpointer user_data)

Creates a new stack to be added to the grid.

#### Parameters

self | an IdeGrid |
user_data | user data set when the signal handler was connected. |

#### Returns

A newly created IdeFrame.

[transfer full]

Flags: Run Last

Since: 3.34

### The `“create-page”` signal

    IdePage*
    user_function (IdeGrid *self,
                   char    *uri,
                   gpointer user_data)

Creates a new page for `uri` to be added to the grid.

#### Parameters

self | an IdeGrid |
uri | the URI to open |
user_data | user data set when the signal handler was connected. |

#### Returns

A newly created IdePage.

[transfer full]

Flags: Run Last

Since: 3.32