6 activate (GApplication
*application
)
8 g_print ("activated\n");
10 /* Note: when doing a longer-lasting action here that returns
11 * to the mainloop, you should use g_application_hold() and
12 * g_application_release() to keep the application alive until
13 * the action is completed.
18 open (GApplication
*application
,
25 for (i
= 0; i
< n_files
; i
++)
27 gchar
*uri
= g_file_get_uri (files
[i
]);
28 g_print ("open %s\n", uri
);
32 /* Note: when doing a longer-lasting action here that returns
33 * to the mainloop, you should use g_application_hold() and
34 * g_application_release() to keep the application alive until
35 * the action is completed.
40 main (int argc
, char **argv
)
45 app
= g_application_new ("org.gtk.TestApplication",
46 G_APPLICATION_HANDLES_OPEN
);
47 g_signal_connect (app
, "activate", G_CALLBACK (activate
), NULL
);
48 g_signal_connect (app
, "open", G_CALLBACK (open
), NULL
);
49 g_application_set_inactivity_timeout (app
, 10000);
51 status
= g_application_run (app
, argc
, argv
);