# Gtk::Application Class Reference

TODO. More...

Inheritance diagram for Gtk::Application:
[legend]
Collaboration diagram for Gtk::Application:
[legend]

List of all members.

## Public Member Functions

virtual | ~Application ()
GtkApplication* | gobj ()
| Provides access to the underlying C GObject.
const GtkApplication* | gobj () const
| Provides access to the underlying C GObject.
GtkApplication* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Glib::ListHandle< Window* > | get_windows ()
| Retrieves the list of windows previously registered with gtk_application_create_window() or add_window().
Glib::ListHandle< const Window* > | get_windows () const
| Retrieves the list of windows previously registered with gtk_application_create_window() or add_window().
void | add_window (Window& window)
| Adds a window to the Gtk::Application.
void | remove_window (Window& window)

## Static Public Member Functions

static Glib::RefPtr< Application > | create (const Glib::ustring& appid, Gio::ApplicationFlags flags=Gio::APPLICATION_FLAGS_NONE)
| Create a new Gtk::Application, or if one has already been initialized in this process, return the existing instance.

## Related Functions

(Note that these are not member functions.)
Glib::RefPtr< Gtk::Application > | wrap (GtkApplication* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

TODO.

## Constructor & Destructor Documentation

virtual Gtk::Application::~Application | ( | ) | `[virtual]`

Reimplemented from Gio::Application.

## Member Function Documentation

void Gtk::Application::add_window | ( | Window& | window ) |

Adds a window to the Gtk::Application.

If all the windows managed by Gtk::Application are closed, the Gtk::Application will call gtk_application_quit(), and quit the application.

If your application uses only a single toplevel window, you can use gtk_application_get_window(). If you are using a sub-class of Gtk::Application you should call gtk_application_create_window() to let the Gtk::Application instance create a Gtk::Window and add it to the list of toplevels of the application. You should call this function only to add Gtk::Windows that you created directly using Gtk::Window::new().

Since gtkmm 3.0:

Parameters:

  window | A toplevel window to add to app.

static Glib::RefPtr<Application> Gtk::Application::create | ( | const Glib::ustring & | appid,
|  | Gio::ApplicationFlags | flags = `Gio::APPLICATION_FLAGS_NONE`
| ) |  | `[static]`

Create a new Gtk::Application, or if one has already been initialized in this process, return the existing instance.

This function will as a side effect initialize the display system; see gtk_init().

For the behavior if this application is running in another process, see Glib::application_new().

Since gtkmm 3.0:

Parameters:

  appid | System-dependent application identifier.
  argc | System argument count.
  argv | System argument vector.

Returns:
  A newly-referenced Gtk::Application.

Reimplemented from Gio::Application.

Glib::ListHandle<Window*> Gtk::Application::get_windows | ( | ) |

Retrieves the list of windows previously registered with gtk_application_create_window() or add_window().

Since gtkmm 3.0:

Returns:
  A pointer to the list of Gtk::Windows registered by this application, or `0`. The returned SList is owned by the Gtk::Application and it should not be modified or freed directly.

Glib::ListHandle<const Window*> Gtk::Application::get_windows | ( | ) | const

Retrieves the list of windows previously registered with gtk_application_create_window() or add_window().

Since gtkmm 3.0:

Returns:
  A pointer to the list of Gtk::Windows registered by this application, or `0`. The returned SList is owned by the Gtk::Application and it should not be modified or freed directly.

GtkApplication* Gtk::Application::gobj | ( | ) | `[inline]`

Provides access to the underlying C GObject.

Reimplemented from Gio::Application.

const GtkApplication* Gtk::Application::gobj | ( | ) | const`[inline]`

Provides access to the underlying C GObject.

Reimplemented from Gio::Application.

GtkApplication* Gtk::Application::gobj_copy | ( | ) |

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

Reimplemented from Gio::Application.

void Gtk::Application::remove_window | ( | Window& | window ) |

## Friends And Related Function Documentation

Glib::RefPtr< Gtk::Application > wrap | ( | GtkApplication * | object,
|  | bool | take_copy = `false`
| ) |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  object | The C instance.
  take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- gtkmm/application.h