elementary-sdk
. Open your meson.build
file and add the new dependency to the executable
method.Gtk.Application
with a correctly set application_id
as we previously set up in Hello World.ninja
to build your project. It should still build without any errors. If you do encounter errors, double check your changes and resolve them before continuing.granite
in your build system and created a new Gtk.Application
with an application_id
, it's time to write some code.12
can be done with the following lines:set_badge_visible
property to true, and use an int64 type for the set_badge
property. The suffix .begin
is required here since these are asynchronous methods.set_progress
takes a double
value type and is a range between 0
and 1
: from 0% to 100%. As with badges, Don't forget that set_progress_visible
must be true
and .begin
is required for asynchronous methods..desktop
file does not involve writing any code or using any external dependencies, though your app needs a way to distinguish between actions, e.g. with command line flags.Actions
line in your app's .desktop file. This line should contain a ;
separated list of unique action names:Icon
line is optional and should be an icon which represents the action that will be performed. The Exec
line is required and should be your app's executable name and any command line argument required to trigger the action.-n
or any other argument will not automatically make your app open a new window; your app must handle and interpret command line arguments. The GLib.Application API provides many examples and an extensive documentation on how to handle these arguments, particularly the command_line signal.