6 command_line (GApplication
*application
,
7 GApplicationCommandLine
*cmdline
)
13 argv
= g_application_command_line_get_arguments (cmdline
, &argc
);
15 g_application_command_line_print (cmdline
,
16 "This text is written back\n"
17 "to stdout of the caller\n");
19 for (i
= 0; i
< argc
; i
++)
20 g_print ("argument %d: %s\n", i
, argv
[i
]);
28 main (int argc
, char **argv
)
33 app
= g_application_new ("org.gtk.TestApplication",
34 G_APPLICATION_HANDLES_COMMAND_LINE
);
35 g_signal_connect (app
, "command-line", G_CALLBACK (command_line
), NULL
);
36 g_application_set_inactivity_timeout (app
, 10000);
38 status
= g_application_run (app
, argc
, argv
);