Function

Gtkinit_with_args

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 gint*
 

Address of the argc parameter of your main() function (or 0 if argv is NULL). This will be changed if any arguments were handled.

 The argument will be modified by the function.
 The called function takes ownership of the data, and is responsible for freeing it.
argv An array of gchar**
 

Address of the argv parameter of main(), or NULL. Any options understood by GTK+ are stripped before return.

 The argument will be modified by the function.
 The length of the array is specified in the argc argument.
 The called function takes ownership of the data, and is responsible for freeing it.
parameter_string const gchar*
 

A string which is displayed in the first line of --help output, after programname [OPTION...]

 The argument can be NULL.
 The data is owned by the caller of the function.
 The string is a NUL terminated UTF-8 string.
entries An array of GOptionEntry
 

A NULL-terminated array of GOptionEntrys describing the options of your program.

 The data is owned by the caller of the function.
translation_domain const gchar*
 

A translation domain to use for translating the --help output for the options in entries and the parameter_string with gettext(), or NULL.

 The argument can be NULL.
 The data is owned by the caller of the function.
 The string is a NUL terminated UTF-8 string.
error GError **
  The return location for a GError*, or NULL.

Return value

Returns: gboolean
 

TRUE if the commandline arguments (if any) were valid and if the windowing system has been successfully initialized, FALSE otherwise.