Function
Gtkinit_with_args
since: 2.6
Declaration [src]
gboolean
gtk_init_with_args (
gint* argc,
gchar*** argv,
const gchar* parameter_string,
const GOptionEntry* entries,
const gchar* translation_domain,
GError** error
)
Description [src]
This function does the same work as gtk_init_check().
Additionally, it allows you to add your own commandline options,
and it automatically generates nicely formatted
--help
output. Note that your program will
be terminated after writing out the help output.
Available since: 2.6
Parameters
argc
-
Type:
gint*
Address of the
argc
parameter of yourmain()
function (or 0 ifargv
isNULL
). This will be changed if any arguments were handled.The argument will be modified by the function. argv
-
Type: An array of
gchar**
Address of the
argv
parameter of main(), orNULL
. Any options understood by GTK+ are stripped before return.The argument will be modified by the function. The argument can be set to NULL
by the function.The length of the array is specified in the argc
argument.The caller of the function takes ownership of the returned data, and is responsible for freeing it. Each element is a NUL terminated UTF-8 string. parameter_string
-
Type:
const gchar*
A string which is displayed in the first line of
--help
output, afterprogramname [OPTION...]
.The argument can be NULL
.The data is owned by the caller of the function. The value is a NUL terminated UTF-8 string. entries
-
Type: An array of
GOptionEntry
A
NULL
-terminated array ofGOptionEntrys
describing the options of your program.The array must be NULL
-terminated.The data is owned by the caller of the function. translation_domain
-
Type:
const gchar*
A translation domain to use for translating the
--help
output for the options inentries
and theparameter_string
with gettext(), orNULL
.The argument can be NULL
.The data is owned by the caller of the function. The value is a NUL terminated UTF-8 string. error
-
Type:
GError **
The return location for a recoverable error.
The argument can be NULL
.If the return location is not NULL
, then you must initialize it to aNULL
GError*
.The argument will be left initialized to NULL
by the function if there are no errors.In case of error, the argument will be set to a newly allocated GError
; the caller will take ownership of the data, and be responsible for freeing it.