init_with_args


Description:


[ Version ( since = "2.6" ) ]
public bool init_with_args (ref unowned string[]? argv, string? parameter_string, OptionEntry[] entries, string? translation_domain) throws Error

This function does the same work as 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.

Parameters:

argv

Address of the `argv` parameter of main, or null. Any options understood by GTK+ are stripped before return.

parameter_string

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

entries

a null-terminated array of OptionEntrys describing the options of your program

translation_domain

a translation domain to use for translating the `--help` output for the options in entries and the parameter_string with gettext, or null

argc

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

Returns:

true if the commandline arguments (if any) were valid and if the windowing system has been successfully initialized, false otherwise


Namespace: Gtk
Package: gtk+-3.0