GeditWindow: gedit Reference Manual

## GeditWindow GeditWindow — A main window |

## Functions

GeditTab * | gedit_window_create_tab ()
void | gedit_window_close_tab ()
void | gedit_window_close_all_tabs ()
void | gedit_window_close_tabs ()
void | gedit_window_set_active_tab ()
GeditTab * | gedit_window_get_active_tab ()
GeditView * | gedit_window_get_active_view ()
GeditDocument * | gedit_window_get_active_document ()
GeditTab * | gedit_window_get_tab_from_location ()
GList * | gedit_window_get_views ()
GList * | gedit_window_get_documents ()
GList * | gedit_window_get_unsaved_documents ()
TeplPanel * | gedit_window_get_side_panel ()
TeplPanel * | gedit_window_get_bottom_panel ()
GtkWidget * | gedit_window_get_statusbar ()
GtkWindowGroup * | gedit_window_get_group ()
GeditMessageBus * | gedit_window_get_message_bus ()
GeditWindowState | gedit_window_get_state ()

## Properties

GeditWindowState | state | Read

## Signals

void | active-tab-changed | Run First
void | tab-added | Run First
void | tab-removed | Run First

## Types and Values

struct | GeditWindow
enum | GeditWindowState

## Object Hierarchy

        GFlags
        ╰── GeditWindowState
        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── GtkBin
                        ╰── GtkWindow
                            ╰── GtkApplicationWindow
                                ╰── GeditWindow

## Implemented Interfaces

GeditWindow implements AtkImplementorIface, GtkBuildable, GActionGroup and GActionMap.

## Description

GeditWindow is a main window, a subclass of GtkApplicationWindow.

It contains GeditTab's.

## Functions

### gedit_window_create_tab ()

    GeditTab *
    gedit_window_create_tab (GeditWindow *window,
                             gboolean jump_to);

Creates a new GeditTab and adds it to the GtkNotebook.

#### Parameters

window | a GeditWindow. |
jump_to | if `TRUE`, the GtkNotebook switches to the new GeditTab. |

#### Returns

the new GeditTab.

[transfer none]

### gedit_window_close_tab ()

    void
    gedit_window_close_tab (GeditWindow *window,
                            GeditTab *tab);

Closes the `tab` .

#### Parameters

window | a GeditWindow. |
tab | the GeditTab to close. |

### gedit_window_close_all_tabs ()

    void
    gedit_window_close_all_tabs (GeditWindow *window);

Closes all tabs of `window` .

#### Parameters

window | a GeditWindow. |

### gedit_window_close_tabs ()

    void
    gedit_window_close_tabs (GeditWindow *window,
                             const GList *tabs);

Closes all tabs specified in `tabs` .

#### Parameters

window | a GeditWindow. |
tabs | a list of GeditTab's. | [element-type GeditTab]

### gedit_window_set_active_tab ()

    void
    gedit_window_set_active_tab (GeditWindow *window,
                                 GeditTab *tab);

Switches to `tab` .

#### Parameters

window | a GeditWindow. |
tab | a GeditTab. |

### gedit_window_get_active_tab ()

    GeditTab *
    gedit_window_get_active_tab (GeditWindow *window);

#### Parameters

window | a GeditWindow. |

#### Returns

the active GeditTab of `window` .

[transfer none][nullable]

### gedit_window_get_active_view ()

    GeditView *
    gedit_window_get_active_view (GeditWindow *window);

#### Parameters

window | a GeditWindow. |

#### Returns

the active GeditView of `window` .

[transfer none][nullable]

### gedit_window_get_active_document ()

    GeditDocument *
    gedit_window_get_active_document (GeditWindow *window);

#### Parameters

window | a GeditWindow. |

#### Returns

the active GeditDocument of `window` .

[transfer none][nullable]

### gedit_window_get_tab_from_location ()

    GeditTab *
    gedit_window_get_tab_from_location (GeditWindow *window,
                                        GFile *location);

#### Parameters

window | a GeditWindow. |
location | a GFile. |

#### Returns

the GeditTab that matches the given `location` .

[transfer none]

### gedit_window_get_views ()

    GList *
    gedit_window_get_views (GeditWindow *window);

#### Parameters

window | a GeditWindow. |

#### Returns

a newly allocated list with all the GeditView's currently part of `window` .

[element-type GeditView][transfer container]

### gedit_window_get_documents ()

    GList *
    gedit_window_get_documents (GeditWindow *window);

#### Parameters

window | a GeditWindow. |

#### Returns

a newly allocated list with all the GeditDocument's currently part of `window` .

[element-type GeditDocument][transfer container]

### gedit_window_get_unsaved_documents ()

    GList *
    gedit_window_get_unsaved_documents (GeditWindow *window);

#### Parameters

window | a GeditWindow. |

#### Returns

a newly allocated list of GeditDocument's part of `window` that currently have unsaved changes.

[element-type GeditDocument][transfer container]

### gedit_window_get_side_panel ()

    TeplPanel *
    gedit_window_get_side_panel (GeditWindow *window);

#### Parameters

window | a GeditWindow. |

#### Returns

the side panel of `window` .

[transfer none]

Since: 46

### gedit_window_get_bottom_panel ()

    TeplPanel *
    gedit_window_get_bottom_panel (GeditWindow *window);

#### Parameters

window | a GeditWindow. |

#### Returns

the bottom panel of `window` .

[transfer none]

Since: 48

### gedit_window_get_statusbar ()

    GtkWidget *
    gedit_window_get_statusbar (GeditWindow *window);

#### Parameters

window | a GeditWindow. |

#### Returns

the GeditStatusbar of `window` .

[transfer none]

### gedit_window_get_group ()

    GtkWindowGroup *
    gedit_window_get_group (GeditWindow *window);

#### Parameters

window | a GeditWindow. |

#### Returns

the GtkWindowGroup in which `window` resides.

[transfer none]

### gedit_window_get_message_bus ()

    GeditMessageBus *
    gedit_window_get_message_bus (GeditWindow *window);

#### Parameters

window | a GeditWindow. |

#### Returns

the GeditMessageBus associated with `window` . The returned reference is owned by the window and should not be unreffed.

[transfer none]

### gedit_window_get_state ()

    GeditWindowState
    gedit_window_get_state (GeditWindow *window);

#### Parameters

window | a GeditWindow. |

#### Returns

the current GeditWindowState of `window` .

## Types and Values

### struct GeditWindow

    struct GeditWindow;

### enum GeditWindowState

Flags for the state of a GeditWindow. The enumerators are flags and can be combined. GeditWindow combines and summarizes the state of its GeditTab's into one GeditWindowState value. See GeditTabState for the more precise states.

#### Members

GEDIT_WINDOW_STATE_NORMAL | No flags. |
GEDIT_WINDOW_STATE_SAVING | A tab is in saving state. |
GEDIT_WINDOW_STATE_PRINTING | There is a printing operation on a tab. |
GEDIT_WINDOW_STATE_LOADING | A tab is in loading or reverting state. |
GEDIT_WINDOW_STATE_ERROR | A tab is in an error state. |

## Property Details

### The `“state”` property

      “state”                    GeditWindowState

The state of the GeditWindow.

Owner: GeditWindow

Flags: Read

## Signal Details

### The `“active-tab-changed”` signal

    void
    user_function (GeditWindow *window,
                   gpointer     user_data)

The ::active-tab-changed signal is emitted when the active GeditTab of `window` changes (including when it becomes `NULL`). You can get its value with `gedit_window_get_active_tab()`.

#### Parameters

window | the GeditWindow emitting the signal. |
user_data | user data set when the signal handler was connected. |

Flags: Run First

Since: 47

### The `“tab-added”` signal

    void
    user_function (GeditWindow *window,
                   GeditTab    *tab,
                   gpointer     user_data)

The ::tab-added signal is emitted right after a GeditTab is added to `window` .

#### Parameters

window | the GeditWindow emitting the signal. |
tab | the added GeditTab. |
user_data | user data set when the signal handler was connected. |

Flags: Run First

### The `“tab-removed”` signal

    void
    user_function (GeditWindow *window,
                   GeditTab    *tab,
                   gpointer     user_data)

The ::tab-removed signal is emitted right after a GeditTab is removed from `window` .

During the signal emission, the `tab` 's GeditView and GeditDocument objects are absent from the lists returned by `gedit_window_get_views()` and `gedit_window_get_documents()` (`tab` is not part of `window` ).

During the signal emission, `tab` is still a valid object. As such you can call functions like `gedit_tab_get_view()` and `gedit_tab_get_document()`, for example to disconnect signal handlers.

#### Parameters

window | the GeditWindow emitting the signal. |
tab | the removed GeditTab. |
user_data | user data set when the signal handler was connected. |

Flags: Run First