App


Description:

[ CCode ( has_construct_function = false ) ]
public App (string name, string? startup_id)

Creates a new App instance for name passing a start-up notification id startup_id.

The name must be a unique identifier for the application, and it must be in form of a domain name, like <literal> org.gnome.YourApplication</literal>.

If startup_id is null the <literal>DESKTOP_STARTUP_ID</literal> environment variable will be check, and if that fails a "fake" startup notification id will be created.

Once you have created a App instance, you should check if any other instance is running, using unique_app_is_running. If another instance is running you can send a command to it, using the send_message function; after that, the second instance should quit. If no other instance is running, the usual logic for creating the application can follow.

Parameters:

name

the name of the application's instance

startup_id

the startup notification id, or null

Returns:

the newly created App instance.