Interface

Gtk-3.0GtkApplicationSignalSignatures

interface SignalSignatures {
    activate: () => void;
    "command-line": (arg0: Gio.ApplicationCommandLine) => number;
    "handle-local-options": (arg0: GLib.VariantDict) => number;
    "name-lost": () => boolean | void;
    notify: (arg0: GObject.ParamSpec) => void;
    "notify::action-group": (pspec: GObject.ParamSpec) => void;
    "notify::active-window": (pspec: GObject.ParamSpec) => void;
    "notify::app-menu": (pspec: GObject.ParamSpec) => void;
    "notify::application-id": (pspec: GObject.ParamSpec) => void;
    "notify::flags": (pspec: GObject.ParamSpec) => void;
    "notify::inactivity-timeout": (pspec: GObject.ParamSpec) => void;
    "notify::is-busy": (pspec: GObject.ParamSpec) => void;
    "notify::is-registered": (pspec: GObject.ParamSpec) => void;
    "notify::is-remote": (pspec: GObject.ParamSpec) => void;
    "notify::menubar": (pspec: GObject.ParamSpec) => void;
    "notify::register-session": (pspec: GObject.ParamSpec) => void;
    "notify::resource-base-path": (pspec: GObject.ParamSpec) => void;
    "notify::screensaver-active": (pspec: GObject.ParamSpec) => void;
    "notify::version": (pspec: GObject.ParamSpec) => void;
    open: (arg0: Gio.File[], arg1: string) => void;
    "query-end": () => void;
    shutdown: () => void;
    startup: () => void;
    "window-added": (arg0: Gtk.Window) => void;
    "window-removed": (arg0: Gtk.Window) => void;
}

Hierarchy (View Summary)

Index

Properties

"notify::action-group": (pspec: GObject.ParamSpec) => void
"notify::active-window": (pspec: GObject.ParamSpec) => void
"notify::app-menu": (pspec: GObject.ParamSpec) => void
"notify::application-id": (pspec: GObject.ParamSpec) => void
"notify::flags": (pspec: GObject.ParamSpec) => void
"notify::inactivity-timeout": (pspec: GObject.ParamSpec) => void
"notify::is-busy": (pspec: GObject.ParamSpec) => void
"notify::is-registered": (pspec: GObject.ParamSpec) => void
"notify::is-remote": (pspec: GObject.ParamSpec) => void
"notify::menubar": (pspec: GObject.ParamSpec) => void
"notify::register-session": (pspec: GObject.ParamSpec) => void
"notify::resource-base-path": (pspec: GObject.ParamSpec) => void
"notify::screensaver-active": (pspec: GObject.ParamSpec) => void
"notify::version": (pspec: GObject.ParamSpec) => void
"query-end": () => void

Emitted when the session manager is about to end the session, only if Gtk.Application.SignalSignatures.register_session | Gtk.Application::register-session is true. Applications can connect to this signal and call gtk_application_inhibit() with Gtk.ApplicationInhibitFlags.LOGOUT to delay the end of the session until state has been saved.

3.24.8

"window-added": (arg0: Gtk.Window) => void

Emitted when a Gtk.Window is added to application through gtk_application_add_window().

3.2

"window-removed": (arg0: Gtk.Window) => void

Emitted when a Gtk.Window is removed from application, either as a side-effect of being destroyed or explicitly through gtk_application_remove_window().

3.2

Properties - Inherited from Gio

activate: () => void

The ::activate signal is emitted on the primary instance when an activation occurs. See g_application_activate().

"command-line": (arg0: Gio.ApplicationCommandLine) => number

The ::command-line signal is emitted on the primary instance when a commandline is not handled locally. See g_application_run() and the Gio.ApplicationCommandLine documentation for more information.

"handle-local-options": (arg0: GLib.VariantDict) => number

The ::handle-local-options signal is emitted on the local instance after the parsing of the commandline options has occurred.

You can add options to be recognised during commandline option parsing using g_application_add_main_option_entries() and g_application_add_option_group().

Signal handlers can inspect options (along with values pointed to from the arg_data of an installed GOptionEntrys) in order to decide to perform certain actions, including direct local handling (which may be useful for options like --version).

In the event that the application is marked Gio.ApplicationFlags.HANDLES_COMMAND_LINE the "normal processing" will send the options dictionary to the primary instance where it can be read with g_application_command_line_get_options_dict(). The signal handler can modify the dictionary before returning, and the modified dictionary will be sent.

In the event that Gio.ApplicationFlags.HANDLES_COMMAND_LINE is not set, "normal processing" will treat the remaining uncollected command line arguments as filenames or URIs. If there are no arguments, the application is activated by g_application_activate(). One or more arguments results in a call to g_application_open().

If you want to handle the local commandline arguments for yourself by converting them to calls to g_application_open() or g_action_group_activate_action() then you must be sure to register the application first. You should probably not call g_application_activate() for yourself, however: just return -1 and allow the default handler to do it for you. This will ensure that the --gapplication-service switch works properly (i.e. no activation in that case).

Note that this signal is emitted from the default implementation of local_command_line(). If you override that function and don't chain up then this signal will never be emitted.

You can override local_command_line() if you need more powerful capabilities than what is provided here, but this should not normally be required.

2.40

"name-lost": () => boolean | void

The ::name-lost signal is emitted only on the registered primary instance when a new instance has taken over. This can only happen if the application is using the Gio.ApplicationFlags.ALLOW_REPLACEMENT flag.

The default handler for this signal calls g_application_quit().

2.60

notify: (arg0: GObject.ParamSpec) => void

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with GObject.ParamFlags.EXPLICIT_NOTIFY, then any call to g_object_set_property() results in ::notify being emitted, even if the new value is the same as the old. If they did pass GObject.ParamFlags.EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

g_signal_connect (text_view->buffer, "notify::paste-target-list",
G_CALLBACK (gtk_text_view_target_list_notify),
text_view)

It is important to note that you must use [canonical parameter names][class@GObject.ParamSpec#parameter-names] as detail strings for the notify signal.

open: (arg0: Gio.File[], arg1: string) => void

The ::open signal is emitted on the primary instance when there are files to open. See g_application_open() for more information.

shutdown: () => void

The ::shutdown signal is emitted only on the registered primary instance immediately after the main loop terminates.

startup: () => void

The ::startup signal is emitted on the primary instance immediately after registration. See g_application_register().