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
argcparameter of yourmain()function (or 0 ifargvisNULL). 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
argvparameter 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 NULLby the function.The length of the array is specified in the argcargument.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
--helpoutput, 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
GOptionEntryA
NULL-terminated array ofGOptionEntrysdescribing 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
--helpoutput for the options inentriesand theparameter_stringwith 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 aNULLGError*.The argument will be left initialized to NULLby 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.