## BtMainWindow

BtMainWindow — root buzztard editor window

## Synopsis

    #include "bt-edit.h"

    struct              BtMainWindow;
    BtMainWindow *      bt_main_window_new                  (void);
    gboolean            bt_main_window_check_unsaved_song   (const BtMainWindow *self,
                                                             const gchar *title,
                                                             const gchar *headline);
    gboolean            bt_main_window_check_quit           (const BtMainWindow *self);
    void                bt_main_window_new_song             (const BtMainWindow *self);
    void                bt_main_window_open_song            (const BtMainWindow *self);
    void                bt_main_window_save_song            (const BtMainWindow *self);
    void                bt_main_window_save_song_as         (const BtMainWindow *self);
    void                bt_dialog_message                   (const BtMainWindow *self,
                                                             const gchar *title,
                                                             const gchar *headline,
                                                             const gchar *message);
    gboolean            bt_dialog_question                  (const BtMainWindow *self,
                                                             const gchar *title,
                                                             const gchar *headline,
                                                             const gchar *message);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GtkObject
                   +----GtkWidget
                         +----GtkContainer
                               +----GtkBin
                                     +----GtkWindow
                                           +----BtMainWindow

## Implemented Interfaces

BtMainWindow implements AtkImplementorIface, GtkBuildable and BtChildProxy.

## Properties

      "dialog"                   GtkDialog*            : Read
      "pages"                    BtMainPages*          : Read
      "statusbar"                BtMainStatusbar*      : Read
      "toolbar"                  BtMainToolbar*        : Read

## Description

The main window class is a container for the BtMainMenu, the BtMainToolbar, the BtMainStatusbar and the BtMainPages tabbed notebook.

## Details

### struct BtMainWindow

    struct BtMainWindow;

the root window for the editor application

### bt_main_window_new ()

    BtMainWindow *      bt_main_window_new                  (void);

Create a new instance

Returns : | the new instance

### bt_main_window_check_unsaved_song ()

    gboolean            bt_main_window_check_unsaved_song   (const BtMainWindow *self,
                                                             const gchar *title,
                                                             const gchar *headline);

Checks if the current song is modified and asks for confirmation to continue (and loose the changes). It only considers the undo/redo stack and not minor changes such as switching tabs or selecting something.

`self` : | the main window instance
`title` : | the title of the message
`headline` : | the bold headline of the message
Returns : | `TRUE` if the user has confirmed to continue

### bt_main_window_check_quit ()

    gboolean            bt_main_window_check_quit           (const BtMainWindow *self);

Displays a dialog box, that asks the user to confirm exiting the application.

`self` : | the main window instance
Returns : | `TRUE` if the user has confirmed to exit

### bt_main_window_new_song ()

    void                bt_main_window_new_song             (const BtMainWindow *self);

Prepares a new song. Triggers cleaning up the old song and refreshes the ui.

`self` : | the main window instance

### bt_main_window_open_song ()

    void                bt_main_window_open_song            (const BtMainWindow *self);

Opens a dialog box, where the user can choose a song to load. If the dialog is not canceld, the old song will be freed, the new song will be loaded and the ui will be refreshed upon success.

`self` : | the main window instance

### bt_main_window_save_song ()

    void                bt_main_window_save_song            (const BtMainWindow *self);

Save the song to disk. If it is a new song it will ask for a file_name and location.

`self` : | the main window instance

### bt_main_window_save_song_as ()

    void                bt_main_window_save_song_as         (const BtMainWindow *self);

Opens a dialog box, where the user can choose a file_name and location to save the song under.

`self` : | the main window instance

### bt_dialog_message ()

    void                bt_dialog_message                   (const BtMainWindow *self,
                                                             const gchar *title,
                                                             const gchar *headline,
                                                             const gchar *message);

Displays a modal message dialog, that needs to be confirmed with "Okay".

`self` : | the applications main window
`title` : | the title of the message
`headline` : | the bold headline of the message
`message` : | the message itself

### bt_dialog_question ()

    gboolean            bt_dialog_question                  (const BtMainWindow *self,
                                                             const gchar *title,
                                                             const gchar *headline,
                                                             const gchar *message);

Displays a modal question dialog, that needs to be confirmed with "Okay" or aborted with "Cancel".

`self` : | the applications main window
`title` : | the title of the message
`headline` : | the bold headline of the message
`message` : | the message itself
Returns : | `TRUE` for Okay, `FALSE` otherwise

## Property Details

### The `"dialog"` property

      "dialog"                   GtkDialog*            : Read

Get the active dialog.

### The `"pages"` property

      "pages"                    BtMainPages*          : Read

Get the pages widget.

### The `"statusbar"` property

      "statusbar"                BtMainStatusbar*      : Read

Get the status bar.

### The `"toolbar"` property

      "toolbar"                  BtMainToolbar*        : Read

Get the toolbar.